import { InjectionToken, NgModule } from '@angular/core';
import { HomeService } from './home.service';

export const API_CONFIG = new InjectionToken('ApiConfigToken')

@NgModule({
  imports: [],
  // Angular6之前的写法，没有使用这个服务，不会被优化
  // providers: [
  //   HomeService,
  // ]
  providers: [
    {
      provide: API_CONFIG,
      useValue: 'http://localhost:3000'
    }
  ]
})
export class ServiceModule { }
